package net.synck.gcontact.test;

import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.layout.GridData;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.SWT;

public class test2 extends Composite {

	private FormToolkit formToolkit = null;   //  @jve:decl-index=0:visual-constraint=""
	private Composite composite = null;
	//private Form form = null;
	private Composite formComposite = null;
	private Composite composite1 = null;
	private Button button = null;

	public test2(Composite parent, int style) {
		super(parent, style);
		initialize();
	}

	private void initialize() {
		createComposite();
		setSize(new Point(300, 200));
		setLayout(new GridLayout());
	}

	/**
	 * This method initializes formToolkit	
	 * 	
	 * @return org.eclipse.ui.forms.widgets.FormToolkit	
	 */
	private FormToolkit getFormToolkit() {
		if (formToolkit == null) {
			formToolkit = new FormToolkit(Display.getCurrent());
		}
		return formToolkit;
	}

	/**
	 * This method initializes composite	
	 *
	 */
	private void createComposite() {
		GridData gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.grabExcessHorizontalSpace = true;
		gridData.grabExcessVerticalSpace = true;
		gridData.verticalAlignment = GridData.FILL;
		composite = getFormToolkit().createComposite(this);
		composite.setLayout(new GridLayout());
		createForm();
		composite.setLayoutData(gridData);
	}

	/**
	 * This method initializes form	
	 *
	 */
	private void createForm() {
		//form = getFormToolkit().createForm(composite);		
		//form.getBody().setLayout(new GridLayout());
		formComposite = getFormToolkit().createComposite(composite);
		formComposite.setLayout(new GridLayout());
		createComposite1();
	}

	/**
	 * This method initializes composite1	
	 *
	 */
	private void createComposite1() {
		composite1 = getFormToolkit().createComposite(formComposite);
		composite1.setLayout(new GridLayout());
		button = getFormToolkit().createButton(composite1, null, SWT.PUSH);
	}

}
